import http from './http';
import Config from "@/config";
import Http from "./http";

export const logOut = () => {
    return http({
        url: '/sys/logout',
        method: 'post'
    })
}
export const updateGameCompany = (data) => {
    return http({
        url: '/just/game-company/updateById',
        method: 'post',
        data
    })
}

export const updateGameType = (data) => {
    return http({
        url: '/just/game-type/updateById',
        method: 'post',
        data
    })
}
export const updatePageType = (data) => {
    return http({
        url: '/art/category/updateById',
        method: 'post',
        data
    })
}
export const addPageType = (data) => {
    return http({
        url: '/art/category/save',
        method: 'post',
        data
    })
}

export const deleteCompanyType = (data) => {
    return http({
        url: '/just/game-company/delete',
        method: 'delete',
        data
    })
}

export const deleteGameType = (data) => {
    return http({
        url: '/just/game-type/delete',
        method: 'delete',
        data
    })
}
export const addGameCompany = (data) => {
    return http({
        url: '/just/game-company/save',
        method: 'post',
        data
    })
}
export const addGameType = (data) => {
    return http({
        url: '/just/game-type/save',
        method: 'post',
        data
    })
}
export const systemDeleteFile = (params) => {
    return http({
        url: `${Config.BASEURL}/sys/f-info/delete`,
        method: 'delete',
        params
    })
}
export const systemUpload = (formData, UploadProgress = null) => {
    return http({
        url: `${Config.BASEURL}/sys/f-info/upload`,
        method: 'post',
        processData: false,
        data: formData,
        onUploadProgress: UploadProgress
    })
}
export const saveNewPage = (data) => {
    return http({
        url: '/art/page/usr/upload',
        method: 'post',
        data
    })
}

export const getGameCompanyList = (params) => {
    return http({
        url: '/just/game-company/list',
        method: 'get',
        params
    })
}

export const getGameTypeList = (params) => {
    return http({
        url: '/just/game-type/list',
        method: 'get',
        params
    })
}

export const getPageCategory = (params) => {
    return http({
        url: '/art/category/list',
        method: 'get',
        params
    })
}


export const resetUserStatus = (params) => {
    return http({
        url: '/admin/user/reset-status',
        method: 'post',
        params: {
            ...params
        }
    })
}

export const deleteArticleById = (params) => {
    return Http({
        url: '/art/page/admin-del',
        method: 'delete',
        params: {
            ...params
        }
    })
}

export const getPageDetail = (value) => {
    return http.get(
        `/art/page/detail?id=${value}`
    )
}

export const getPageContentText = (value) => {
    return http.get(
        `/art/page/get-raw?id=${value}`
    )
}

